<template>
  <basic-import :columns="columns"
                :api="api"
                :templateUrl="templateUrl"
                templateName="GoodsImport" />
</template>

<script>
import BasicImport from "./BasicImport";
import { goods } from "@/api/index";
export default {
  name: "GoodsImport",
  components: { BasicImport },

  data () {
    return {
      columns: [
        {
          label: "物品名称",
          name: "name"
        },
        {
          label: "物品类型",
          name: "goodsType"
        },
        {
          label: "发货方名称",
          name: "customerName"
        },
        {
          label: "物品价值(元)",
          name: "value",
          minWidth: "90px"
        },
        {
          label: "规格",
          name: "spec"
        },
        {
          label: "体积(方)",
          name: "volume"
        },
        {
          label: "重量(公斤)",
          name: "netWeight"
        },
        {
          label: "毛重(公斤)",
          name: "grossWeight"
        },
        {
          label: "数量单位",
          name: "goodsUnit",
          enumArr: [
            "公斤",
            "吨",
            "立方米",
            "升",
            "个",
            "托",
            "台",
            "箱",
            "包",
            "捆",
            "辆",
            "件",
            "袋",
            "架",
            "盒",
            "其他",
            "EA",
            "TA"
          ],
          type: "enum"
        },
        {
          label: "物料编码",
          name: "barcode"
        },
        {
          label: "箱入数",
          name: "quantity"
        },
        {
          label: "长(米)",
          name: "length"
        },
        {
          label: "宽(米)",
          name: "width"
        },
        {
          label: "高(米)",
          name: "height"
        }
      ],
      api: goods,
      templateUrl: "/excelTemplate/物品信息导入模版.xlsx"
    };
  }
};
</script>
